<template>

    <div>
        <div>
            <el-form :model="form" :rules="rules" ref="form" class="demo-ruleForm" :inline="true" size="mini">
                <el-tabs>
                    <el-tab-pane label="客源资料">
                        <!-- 客源 -->
                            <!-- 客户信息  85 -->
                            <div class="row">
                                <el-form-item label="客户" prop="c_user_name">
                                    <el-input v-model="form.c_user_name" :type="lookPrivate" :readonly=" JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_kehuxingming) == -1"></el-input>
                                </el-form-item>
                                <el-form-item label="手机" prop="c_user_phone">
                                    <el-input v-model="form.c_user_phone" :type="lookPrivate" @blur="c_validateTel" :readonly=" JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_kehudianhua) == -1 "></el-input>
                                </el-form-item>
                                <el-form-item label="联系人" prop="c_contact">
                                    <el-input v-model="form.c_contact" :type="lookPrivate" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_lianxirendianhua) == -1 "></el-input>
                                </el-form-item>
                                <el-form-item label="联系人电话" prop="c_contact_type">
                                    <el-input v-model="form.c_contact_type" :type="lookPrivate" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_lianxirendianhua) == -1 "></el-input>
                                </el-form-item>
                                <el-form-item label="身份证" prop="c_id_card">
                                    <el-input v-model="form.c_id_card"></el-input>
                                </el-form-item>
                                <el-form-item label="现住址" prop="c_address">
                                    <el-input v-model="form.c_address" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_kehuzhuzhi) == -1 "></el-input>
                                </el-form-item>
                                <el-form-item label="等级" prop="c_user_level">
                                    <el-select v-model="form.c_user_level" placeholder="请选择" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_dengji) == -1 ">
                                        <el-option v-for="(item,index) in customeroptlist.grade" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="现住" prop="c_live_type">
                                    <el-select v-model="form.c_live_type" placeholder="请选择">
                                        <el-option v-for="(item,index) in customeroptlist.nowliving" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="类别" prop="c_professional_type">
                                    <el-select v-model="form.c_professional_type" placeholder="请选择">
                                        <el-option v-for="(item,index) in customeroptlist.type" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="意向" prop="c_user_intention">
                                    <el-select v-model="form.c_user_intention" placeholder="请选择">
                                        <el-option v-for="(item,index) in customeroptlist.intention" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="期限" prop="c_time_limit">
                                    <el-select v-model="form.c_time_limit" placeholder="请选择">
                                        <el-option v-for="(item,index) in customeroptlist.term" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div class="row">
                                <!-- 交易信息  42 -->
                                <div class="column left">
                                    <el-form-item label="交易" prop="c_trading_type">
                                        <el-select v-model="form.c_trading_type" placeholder="请选择" @change="transactChange" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_jiaoyileixing) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.transaction" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="状态" prop="c_buy_status">
                                        <el-select v-model="form.c_buy_status" placeholder="请选择" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_zhuangtai) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.status" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item prop="c_private_guest">
                                        <el-checkbox v-model="form.c_private_guest" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_sike) == -1 ">私客</el-checkbox>
                                    </el-form-item>
                                    <el-form-item prop="c_quality">
                                        <el-checkbox v-model="form.c_quality" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_youzhike) == -1 ">优质客</el-checkbox>
                                    </el-form-item>
                                    <div>
                                        <el-form-item label="地址">
                                            <el-select v-model="customeroptlist.city_name" placeholder="市" disabled>
                                            </el-select>
                                        </el-form-item>
                                        <el-form-item label="" prop="c_secondary_area">
                                            <el-select v-model="form.c_secondary_area" placeholder="区" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_jutidizhi) == -1 ">
                                                <el-option v-for="(item,index) in customeroptlist.area_list" :key="index" :label="item.name" :value="item.code"></el-option>
                                            </el-select>
                                        </el-form-item>
                                        <el-form-item label="" prop="c_area_address" class="mini_inp">
                                            <el-input v-model="form.c_area_address" placeholder="请输入详细地址" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_jutidizhi) == -1 "></el-input>
                                        </el-form-item>
                                    </div>
                                    <el-form-item label="房型" prop="c_room" class="mini_inp" v-if="typeOne === 1">
                                        <el-select v-model="form.c_room" placeholder="" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_fangxing) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.roomtype" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>室
                                    </el-form-item>
                                    <el-form-item label="" prop="office_s" class="mini_inp" v-if="typeOne === 1">
                                        <el-select v-model="form.c_room_json.office_s" placeholder="" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_fangxing) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.hall" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>厅
                                    </el-form-item>
                                    <el-form-item label="" prop="guard_s" class="mini_inp" v-if="typeOne === 1">
                                        <el-select v-model="form.c_room_json.guard_s" placeholder="" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_fangxing) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.guard" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>卫
                                    </el-form-item>
                                    <el-form-item label="" prop="balcony_s" class="mini_inp" v-if="typeOne === 1">
                                        <el-select v-model="form.c_room_json.balcony_s" placeholder="" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_fangxing) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.balcony" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>阳台
                                    </el-form-item>
                                    <el-form-item label="位置" prop="c_position" v-if="typeOne === 2">
                                        <el-select v-model="form.c_position" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.position" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="位置" prop="c_position" v-if="typeOne === 7">
                                        <el-select v-model="form.c_position" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.positionfour" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="级别" prop="c_level" v-if="typeOne === 3">
                                        <el-select v-model="form.c_level" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.level" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="员工" prop="staff_s" class="small_inp" v-if="typeOne === 4 || typeOne === 5">
                                        <el-input v-model="form.c_room_json.staff_s"></el-input>
                                    </el-form-item>
                                    <el-form-item label="宿舍" prop="dormitory_s" class="small_inp" v-if="typeOne === 4 || typeOne === 5">
                                        <el-input v-model="form.c_room_json.dormitory_s"></el-input>
                                    </el-form-item>
                                    <el-form-item label="办公" prop="work_office" class="small_inp" v-if="typeOne === 4 || typeOne === 5">
                                        <el-input v-model="form.c_room_json.work_office"></el-input>
                                    </el-form-item>
                                    <el-form-item label="空地" prop="vacant_land" class="small_inp" v-if="typeOne === 4 || typeOne === 5">
                                        <el-input v-model="form.c_room_json.vacant_land"></el-input>
                                    </el-form-item>
                                    <el-form-item label="规划" prop="c_planning" v-if="typeOne === 6">
                                        <el-select v-model="form.c_planning" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.planning" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="厂房" prop="c_acreage_min" class="mini_inp" v-if="typeOne === 4">
                                        <el-input v-model="form.c_acreage_min"></el-input>
                                    </el-form-item><span v-if="typeOne === 4">_</span> 
                                    <el-form-item label="" prop="c_acreage_max" class="mini_inp" v-if="typeOne === 4">
                                        <el-input v-model="form.c_acreage_max" style="vertical-align: top;"></el-input>
                                    </el-form-item><span style="font-size:12px;vertical-align: sub;" v-if="typeOne === 4">m<sup>2</sup></span>
                                    
                                    <el-form-item label="仓库" prop="c_acreage_min" class="mini_inp" v-if="typeOne === 5">
                                        <el-input v-model="form.c_acreage_min"></el-input>
                                    </el-form-item><span v-if="typeOne === 5">_</span> 
                                    <el-form-item label="" prop="c_acreage_max" class="mini_inp" v-if="typeOne === 5">
                                        <el-input v-model="form.c_acreage_max" style="vertical-align: top;"></el-input>
                                    </el-form-item><span style="font-size:12px;vertical-align: sub;" v-if="typeOne === 5">m<sup>2</sup></span>

                                    <el-form-item label="面积" prop="c_acreage_min" class="mini_inp" v-if="typeOne === 1 || typeOne === 2 || typeOne === 3 || typeOne === 6 || typeOne === 7">
                                        <el-input v-model="form.c_acreage_min" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_zuidamianji) == -1 "></el-input>
                                    </el-form-item><span v-if="typeOne === 1 || typeOne === 2 || typeOne === 3 || typeOne === 6 || typeOne === 7">_</span>
                                    <el-form-item label="" prop="c_acreage_max" class="mini_inp" v-if="typeOne === 1 || typeOne === 2 || typeOne === 3 || typeOne === 6 || typeOne === 7">
                                        <el-input v-model="form.c_acreage_max" style="vertical-align: top;" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_zuixiaomianji) == -1 "></el-input>
                                    </el-form-item><span style="font-size:12px;vertical-align: sub;" v-if="typeOne === 1 || typeOne === 2 || typeOne === 3 || typeOne === 6 || typeOne === 7">m<sup>2</sup></span>

                                    <el-form-item label="委托" prop="c_entrust_time">
                                        <el-date-picker type="date" placeholder="请选择" v-model="form.c_entrust_time" value-format="yyyy-MM-dd" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_weituoshijian) == -1 "></el-date-picker>
                                    </el-form-item>
                                    <el-form-item label="售价" prop="c_price_min" class="mini_inp">
                                        <el-input v-model="form.c_price_min" :readonly="transaction === 2 ? true:false || JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_zuidashoujia) == -1 "></el-input>
                                    </el-form-item>_ 
                                    <el-form-item label="" prop="c_price_max" class="mini_inp">
                                        <el-input v-model="form.c_price_max" style="vertical-align: top;" :readonly="transaction === 2 ? true:false || JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_zuixiaoshoujia) == -1 "></el-input>
                                    </el-form-item><span style="font-size:12px;vertical-align: sub;">万</span>
                                    <el-form-item label="租价" prop="c_rent_price_min" class="mini_inp">
                                        <el-input v-model="form.c_rent_price_min" :readonly="transaction === 1 ? true:false"></el-input>
                                    </el-form-item>_ 
                                    <el-form-item label="" prop="c_rent_price_max" class="mini_inp">
                                        <el-input v-model="form.c_rent_price_max" style="vertical-align: top;" :readonly="transaction === 1 ? true:false"></el-input>
                                    </el-form-item><span style="font-size:12px;vertical-align: sub;">元/月</span>
                                    <el-form-item label="来源" prop="c_source_type">
                                        <el-select v-model="form.c_source_type" placeholder="请选择" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_laiyuan) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.source" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="" prop="c_entrust_type">
                                        <el-select v-model="form.c_entrust_type" placeholder="请选择" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_weituofangshi) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.signing" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                                <!-- 当前信息  62 -->
                                <div class="column right">
                                    <el-form-item label="用途" prop="c_use_type">
                                        <el-select v-model="form.c_use_type" placeholder="请选择" @change="typeChange" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_yongtu) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.use" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="楼层" prop="c_floor" class="small_inp" v-if="typeOne === 1 || typeOne === 3">
                                        <el-input v-model="form.c_floor"></el-input>
                                    </el-form-item>
                                    <el-form-item label="行业" prop="c_industry" v-if="typeOne === 2">
                                        <el-input v-model="form.c_industry"></el-input>
                                    </el-form-item>
                                    <el-form-item label="电量" prop="c_electricity" class="small_inp" v-if="typeOne === 4 || typeOne === 5">
                                        <el-input v-model="form.c_electricity" style="vertical-align: top;"></el-input>m<sup>2</sup>
                                    </el-form-item>
                                    <el-form-item label="停车" prop="c_parking" class="small_inp" v-if="typeOne === 6 || typeOne === 7">
                                        <el-input v-model="form.c_parking" style="vertical-align: top;"></el-input>m<sup>2</sup>
                                    </el-form-item>
                                    <el-form-item label="类型" prop="c_room_type" v-if="typeOne === 1">
                                        <el-select v-model="form.c_room_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.residential_type" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="类型" prop="c_room_type" v-if="typeOne === 2">
                                        <el-select v-model="form.c_room_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.typefives" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="类型" prop="c_room_type" v-if="typeOne === 3">
                                        <el-select v-model="form.c_room_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.typeone" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="类型" prop="c_room_type" v-if="typeOne === 4 || typeOne === 5">
                                        <el-select v-model="form.c_room_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.typetwo" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="类型" prop="c_room_type" v-if="typeOne === 6">
                                        <el-select v-model="form.c_room_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.typethree" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="类型" prop="c_room_type" v-if="typeOne === 7">
                                        <el-select v-model="form.c_room_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.typefour" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="朝向" prop="c_toward" v-if="typeOne === 1">
                                        <el-select v-model="form.c_toward" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.oriented" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="层数" prop="c_number_of_layers" v-if="typeOne === 2 ">
                                        <el-select v-model="form.c_number_of_layers" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.numberlayers" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="层数" prop="c_number_of_layers" v-if="typeOne === 3">
                                        <el-select v-model="form.c_number_of_layers" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.numberlayers_xx" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="层数" prop="c_number_of_layers" v-if="typeOne === 4 || typeOne === 5">
                                        <el-select v-model="form.c_number_of_layers" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.numberlayerstwo" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="装修" prop="c_decorate_type" v-if="typeOne === 1">
                                        <el-select v-model="form.c_decorate_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.residential_decoration" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="厕所" prop="c_wc" v-if="typeOne === 2">
                                        <el-select v-model="form.c_wc" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.wc" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="厕所" prop="c_wc" v-if="typeOne === 3">
                                        <el-select v-model="form.c_wc" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.wcone" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="状况" prop="c_situation" v-if="typeOne === 6">
                                        <el-select v-model="form.c_situation" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.situationthree" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="状况" prop="c_situation" v-if="typeOne === 7">
                                        <el-select v-model="form.c_situation" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.situationfour" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="围墙" prop="c_fence" v-if="typeOne === 4 || typeOne === 5">
                                        <el-select v-model="form.c_fence" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.fencetwo" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="围墙" prop="c_fence" v-if="typeOne === 6">
                                        <el-select v-model="form.c_fence" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.fencethree" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="围墙" prop="c_fence" v-if="typeOne === 7">
                                        <el-select v-model="form.c_fence" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.fencefour" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="付款" prop="c_payment_type">
                                        <el-select v-model="form.c_payment_type" placeholder="请选择" :disabled="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_fukuanleixing) == -1 ">
                                            <el-option v-for="(item,index) in customeroptlist.payment" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="配套" prop="c_complete" v-if="typeOne === 1">
                                        <el-select v-model="form.c_complete" multiple placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.matching" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="配套" prop="c_complete" v-if="typeOne === 3">
                                        <el-select v-model="form.c_complete" multiple placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.matchingone" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="配套" prop="c_complete" v-if="typeOne === 4 || typeOne === 5">
                                        <el-select v-model="form.c_complete" multiple placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.matchingtwo" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="配套" prop="c_complete" v-if="typeOne === 6">
                                        <el-select v-model="form.c_complete" multiple placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.matchingthree" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="配套" prop="c_complete" v-if="typeOne === 7">
                                        <el-select v-model="form.c_complete" multiple placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.matchingfour" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="地段" prop="c_lot" v-if="typeOne === 2">
                                        <el-select v-model="form.c_lot" multiple placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.lot" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="付佣" prop="c_pay_type">
                                        <el-select v-model="form.c_pay_type" placeholder="请选择">
                                            <el-option v-for="(item,index) in customeroptlist.commission" :key="index" :label="item.st_name" :value="item.st_id"></el-option>
                                        </el-select>
                                    </el-form-item>

                                </div>
                            </div>
                            <div class="row">

                                <el-form-item label="备注" prop="c_remark">
                                    <el-input type="textarea" v-model="form.c_remark" placeholder="请输入需要补充的内容" :readonly="JtransformStr(permissionFieldArr) == '{}' ? false : ownerPermissionArr.indexOf(permissionFieldArr.qx_keyuan_beizhu) == -1 "></el-input>
                                </el-form-item>
                                <div> 
                                    <el-form-item label="员工" prop="c_store_id">
                                        <el-select v-model="form.c_store_id" placeholder="请选择部门" @change="obtainUsers">
                                            <!-- <el-option v-for="(item,index) in optionName" :key="index" :label="item.name" :value="item.id"></el-option> -->
                                            <el-option-group v-for="group in optionName" :key="group.label" :label="group.label">
                                                <el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value">
                                                </el-option>
                                            </el-option-group>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="" prop="c_employees_id">
                                        <el-select v-model="form.c_employees_id" placeholder="请选择员工">
                                            <el-option v-for="(item,index) in userTypes" :key="index" :label="item.u_username" :value="item.u_id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </div>
                            </div>

                        <!-- </el-form> -->
                    </el-tab-pane>
                    
                </el-tabs>
            </el-form>
            <div slot="footer" class="dialog-footer" style="text-align:center;padding-bottom: 20px;">
                <el-button @click="cancel('form')" size="mini" v-if="backlist == 0">返回列表</el-button>
                <el-button type="primary" @click="submit('form')" size="mini" :disabled="!preservation">保 存</el-button>
                <el-button type="primary" @click="followup" size="mini" v-show="followstatus">添加客源跟进</el-button>
            </div>
            
        </div>
        <div>
            <!-- 添加跟进 -->
            <div>
                <el-dialog title="客源跟进" :visible.sync="gjdialogFormVisible" v-if="gjdialogFormVisible" width="600px" append-to-body>
                    <!--     classdata：1为添加跟进，2为修改跟进   resourcesdata: 1为房源，2为客源   permissionFollowVal （公客）看客户不必写跟进 权限 0为要写，1为不用写 -->
                    <Editfollow :followsearch="{}" :parentid="c_id" :resourcesdata="2" :classdata="classdata" :permissionFollow="permissionFollowVal" @followevent="followievent" @addfollowP="addfollowPer" />
                </el-dialog>
            </div>
            <!-- 业绩分配 -->
            <div>
                <el-dialog title="业绩分配" :visible.sync="achievementVisible" width="600px">
                    <el-form :model="achievementform" ref="achievementform" inline size="mini" :rules="achievementrules">
                        <el-form-item label="房源">
                            <el-input placeholder="请选择" :value="choose_info_str" class="normal_inp" style="width:384px;" readonly>
                                <el-button slot="append" @click="choose_housing">选择</el-button>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="类型" prop="a_type" class="normal_inp">
                            <el-select v-model="achievementform.a_type" placeholder="请选择" @change="atypechange">
                                <el-option label="单人完成" value="1"></el-option>
                                <el-option label="多人完成" value="2"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="业绩总提成" prop="a_money">
                            <el-input v-model="achievementform.a_money" class="normal_inp"></el-input>
                        </el-form-item>
                        <div v-for="(list,index) in achievement_userlist" :key="index">
                            <el-form-item label="部门" prop="department_id">
                                <el-select v-model="list.department_id" placeholder="请选择" @change="obtainuser">
                                    <!-- <el-option v-for="(item,index) in optionName" :key="index" :label="item.name" :value="item.id"></el-option> -->
                                    <el-option-group v-for="group in optionName" :key="group.label" :label="group.label">
                                        <el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value">
                                        </el-option>
                                    </el-option-group>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="员工" prop="user_id">
                                <el-select v-model="list.user_id" placeholder="请选择">
                                    <el-option v-for="(item,index) in usertypes" :key="index" :label="item.u_username" :value="item.u_id"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="分配比例" prop="percent">
                                <el-input type="number" max="100" v-model="list.percent" class="mini_inp"></el-input>%
                            </el-form-item>
                            <el-button type="danger" icon="el-icon-delete" circle @click="del_user(index)" size="mini" v-show="achievement_userlist.length != 1"></el-button>
                        </div>
                        
                        <el-button @click="add_user" type="primary" icon="el-icon-circle-plus-outline" size="mini" style="margin: 0px 0px 10px 36px;" v-if="achievementaddbtn">添加部门员工</el-button>
                        <div>
                            <el-form-item label="备注" prop="a_remark">
                                <el-input type="textarea" v-model="achievementform.a_remark" class="normal_inp"></el-input>
                            </el-form-item>
                        </div>
                        
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="achievementcancel('achievementform')" size="mini">取 消</el-button>
                        <el-button type="primary" @click="achievementsubmit('achievementform')" size="mini">保 存</el-button>
                    </div>
                </el-dialog>
            </div>
            <!-- 添加跟进  选择房源 -->
            <el-dialog title="选择房源" :visible.sync="choosekydialogTableVisible" append-to-body>
                <!-- typedata: 1为房源，2为客源-->
                <Chooselist :typedata="2" @choose_info_strs="chooseievent" />
            </el-dialog>
            <!-- 重复客源手机号   警告 -->
            <el-dialog title="警告" :visible.sync="repeatdialogVisible" width="30%">
                <p>发现重复的客源客户手机号！</p>
                <p>手机号为：<span style="color:brown;">[{{customer_telephone}}]</span></p>
                <p>是否打开该客源信息？</p>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="repeatcancel" size="mini">取 消</el-button>
                    <el-button type="primary" @click="repeatsubmit" size="mini">确 定</el-button>
                </span>
            </el-dialog>
            <!-- 委托时间   警告 -->
            <el-dialog title="警告" :visible.sync="entrustdialogVisible" width="30%">
                <p>房源改为【有效】状态可自动修改【委托日期】为今天。是否确定要修改？</p>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="entrustcancel" size="mini">取 消</el-button>
                    <el-button type="primary" @click="entrustsubmit" size="mini">确 定</el-button>
                </span>
            </el-dialog>
        </div>
    </div>
</template>

<script>
    import conf from '../../../../config/userconf.js'
    import permconfig from '../../../../config/permconfig.js';
    
    export default {
        name: "Editresources",
        props: {
            backlist: {   //   backlist 判断是否有返回列表按钮，0为有，1为无
                type: String,
                required: true,
            },
            maininfo: {   //   maininfo判断是否返回有底部房源主要信息  0为无 1为有
                type: String,
                required: true,
            }          
        },
        data () {
            var validatePhone = (rule,value,callback) => {    //正则手机号

                var MobileRegex = /^1[3|4|5|7|8][0-9]{9}$/;
                if (!MobileRegex.test(value)) {
                    callback(new Error('手机号格式不正确！'))
                } else {
                    callback();
                }
            };
            var isCardNo = (rule,value,callback) => {    //正则身份证
                                    
                var MobileRegex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
                // var MobileRegex = /(^\d{14}[[0-9],0-9xX]$)|(^\d{17}[[0-9],0-9xX]$)/;
                if (!MobileRegex.test(value)) {
                    callback(new Error('身份证格式不正确！'))
                } else {
                    callback();
                }
            };
            return {
                form: {
                    c_user_name: '',
                    c_user_phone: '',
                    c_contact: '',
                    c_contact_type: '',
                    c_id_card: '',
                    c_address: '',
                    c_user_level: '',
                    c_live_type: '',
                    c_professional_type: '',
                    c_user_intention: '',
                    c_time_limit: '',
                    c_trading_type: '',
                    c_buy_status: '',
                    c_private_guest: true,  //私客
                    c_quality: false,  //优质客
                    c_secondary_area: '',
                    c_area_address: '',
                    c_room: '',  //房型 （几室）
                    c_room_json: {
                        office_s: '',
                        guard_s: '',
                        balcony_s: '',
                        staff_s: '',
                        dormitory_s: '',
                        work_office: '',
                        vacant_land: '',
                    },
                    c_position: '',
                    c_level: '',
                    c_planning: '',
                    c_acreage_min: '',
                    c_acreage_max: '',
                    c_entrust_time: '',
                    c_price_min: '',
                    c_price_max: '',
                    c_rent_price_min: '',
                    c_rent_price_max: '',
                    c_source_type: '',
                    c_entrust_type: '',
                    c_use_type: 3,  //用途    默认 3住宅
                    c_floor: '',
                    c_industry: '',
                    c_electricity: '',
                    c_parking: '',
                    c_room_type: '',
                    c_toward: '',
                    c_number_of_layers: '',
                    c_decorate_type: '',
                    c_wc: '',
                    c_situation: '',
                    c_fence: '',
                    c_payment_type: '',
                    c_complete: [],
                    c_lot: [],
                    c_pay_type: '',
                    c_remark: '',
                    c_store_id: '',
                    c_employees_id: '',
                },
                rules:{
                    c_user_name: [
                        { required: true, message: '请输入客户姓名', trigger: 'blur' }
                    ],
                    c_user_phone: [
                        { required: true, message: '请输入客户手机号', trigger: 'blur' },
                        { validator: validatePhone, trigger: 'blur'},
                    ],
                    c_trading_type: [
                        { required: true, message: '请选择交易类型', trigger: 'change' }
                    ],
                    c_buy_status: [
                        { required: true, message: '请选择购买状态', trigger: 'change' }
                    ],
                    c_private_guest: [
                        { required: true, message: '请输入房号', trigger: 'blur' }
                    ],
                    c_secondary_area: [
                        { required: true, message: '请选择区县', trigger: 'change' }
                    ],
                    c_acreage_max: [
                        { required: true, message: '请输入面积最大值', trigger: 'blur' }
                    ],
                    c_acreage_min: [
                        { required: true, message: '请输入面积最小值', trigger: 'blur' }
                    ],
                    c_entrust_time: [
                        { required: true, message: '请选择委托时间', trigger: 'change' }
                    ],
                    c_source_type: [
                        { required: true, message: '请选择来源类型', trigger: 'change' }
                    ],
                    c_use_type: [
                        { required: true, message: '请选择用途类型', trigger: 'change' }
                    ],
                    c_store_id: [
                        { required: true, message: '请选择部门', trigger: 'change' }
                    ],
                    c_employees_id: [
                        { required: true, message: '请选择员工', trigger: 'change' }
                    ],
                    c_id_card: [
                        { required: false, message: '请填写身份证号', trigger: 'blur' },
                        {
                            validator:(rule,value,callback)=>{
                                if(value != ""){
                                    isCardNo(rule,value,callback)
                                }else{
                                    callback();
                                }
                            }, trigger: 'blur'
                        },
                    ],
                },
                preservation: true,   //是否可保存
                customeroptlist: '',  //客源下拉数据
                typeOne: 1,  //用途更改    所填资料类型
                options: '',  //所有下拉数据
                transaction: 1,// 交易类型  1 求购、2 求租 、3 租购
                optionName: [],
                userTypes: [],
                usertypes: [],  //跟进  查询条件  员工
                usertypess: [],
                r_id: '',  // 房源id
                c_id: '',  // 客源id
                choose_room_info: '',//选择房源的信息内容
                preservation: true,   //是否可保存
                followstatus: false,//添加跟进  状态
                gjdialogFormVisible: false,  // 跟进弹框
                followform: {
                    cf_user_id: '',
                    cf_department_id: '',
                    cf_fllow_type: '',
                    cf_content: '',
                    cfs_remind_time: '',
                    cfs_type: 2,   //类型（1房源提醒 2客源提醒）
                    cfs_user_id: '',
                    cfs_content: '',
                },
                followrules: {
                    cf_user_id: [
                        { required: true, message: '请选择跟进人', trigger: 'change' }
                    ],
                    cf_department_id: [
                        { required: true, message: '请选择跟进人所在部门', trigger: 'change' }
                    ],
                    cf_fllow_type: [
                        { required: true, message: '请选择跟进方式', trigger: 'change' }
                    ],
                    cf_content: [
                        { required: true, message: '请输入跟进内容', trigger: 'blur' },
                        { min: 6, message: '最少输入6个字符', trigger: 'blur' }
                    ],
                },
                follow_up_way: [   // 客源跟进  跟进方式 下拉选项
                    {value: '去电' , id: '1'},
                    {value: '来电' , id: '2'},
                    {value: '看房' , id: '3'},
                    {value: '勘察' , id: '4'},
                    {value: '来访' , id: '5'},
                    {value: '拜访' , id: '6'},
                    {value: '派单' , id: '7'},
                    {value: '短信' , id: '8'},
                    {value: '邮件' , id: '9'},
                    {value: '信函' , id: '10'},
                    {value: '申请' , id: '11'},
                    {value: '修改' , id: '12'},
                    {value: '保留' , id: '13'},
                    {value: '其他' , id: '14'},
                ],
                cfs_user: [   // 客源跟进  提醒范围  下拉选项
                    {value: '本人' , id: '1'},
                    {value: '本部' , id: '2'},
                ],
                choosekydialogTableVisible: false,   // 房源  弹框
                housingData: [],   // 房源列表
                housingform: {
                    r_d_id: '',
                    source_uid: '',
                    a_id: '',
                    trading_type: '',
                    status: '',
                    keywords: '',
                },
                remind: false,   //添加跟进 提醒状态
                achievementform: {  // 业绩分配 表单数据
                    a_type: '',
                    a_money: '',
                    percent: '',  //提成比例
                    user_id: '',  //员工id
                    a_remark: '',
                },
                achievementVisible: false,  //业绩分配  弹框显示隐藏
                entrust_time_confirm_status: false,  //修改委托时间已操作（不论是否修改）  用来判断是否已知会过用户
                customer_telephone: '',  //重复的客源客户手机号
                repeatData: '',  //重复客源数据
                department_name: '',  //部门name
                staff_name: '',  //员工name
                achievementeditinfo: '',  //修改时需要进行业绩分配   存储的数据
                achievementData: [],   //业绩分配
                achievementaddbtn: false,  //业绩分配   添加员工信息  btn
                achievement_userlist: [{user_id:'',percent:'',department_id:''}],  //业绩分配  多人分配
                achievementrules: {//业绩分配   表单校验
                    a_type: [
                        { required: true, message: '请选择类型', trigger: 'change' }
                    ],
                    a_money: [
                        { required: true, message: '请输入业绩提成', trigger: 'blur' }
                    ],
                },
                customer_telephone: '',  //重复的客源客户手机号
                trading_type_opt: [  //交易类型下拉数据
                    {name: '求购',id: '1'},
                    {name: '求租',id: '2'},
                ],
                repeatdialogVisible: false,
                entrustdialogVisible: false,
                entrust_time_status: '',
                choose_info_str: '',   //房客源跟进 跟进方式为看房时   选择房客源  展示数据
                tjstatus: 1,   // 页面   1 添加    2 修改 
                classdata: 1,  //1为添加跟进，2为修改跟进
                ownerPermissionArr: [],  //账号权限数组
                permissionFieldArr: {},  //字段权限对象  
                lookPrivate: 'text',   //查看私客权限 (限制客户姓名电话等)
                permissionFollowVal: 0,  //看客户不必写跟进   0为要写，1为不要写
                editresourcesrowdata: '',  //编辑页存储的数据
                editresourcesrowdatajson: '',  //编辑页存储的数据json
                mineId: '',  //自己的id
            }
        },
        methods: {
            //字符串转换int数组
            intarrFun(val){
                val = val + ',';
                if(typeof(val) == 'string'){
                    val = val.split(',');//分割成字符串数组
                    var dataIntArrs=[];//保存转换后的整型字符串
                    //字符串数组转为整形字符串  
                    // val.forEach(function(data,index,arr){  
                    //     dataIntArrs.push(+data);  
                    // });
                    for(var i=0; i< val.length-1; i++){
                        dataIntArrs.push(parseInt(val[i]));
                    }
                    return dataIntArrs;
                }
            },
            //提交之前  数据处理
            submitbeforeFun(){
                //配套、地段   多选下拉         数组转字符串
                if(Array.isArray(this.form.c_complete)){
                    var c_completes = this.form.c_complete;
                    this.form.c_complete = c_completes.join();
                }
                if(Array.isArray(this.form.c_lot)){
                    var c_lots = this.form.c_lot;
                    this.form.c_lot = c_lots.join();
                }
                
                //私客  优质客   转换为对应参数
                if(this.form.c_private_guest === true){
                    this.form.c_private_guest = 1;
                }else if(this.form.c_private_guest === false){
                    this.form.c_private_guest = 2;
                }
                if(this.form.c_quality === true){
                    this.form.c_quality = 1;
                }else if(this.form.c_quality === false){
                    this.form.c_quality = 2;
                }
            },
            //提交之后   数据处理
            submitafterFun(){
                //私客  优质客   参数转换为true  false
                if(this.form.c_private_guest === 1){
                    this.form.c_private_guest = true;
                }else if(this.form.c_private_guest === 2){
                    this.form.c_private_guest = false;
                }
                if(this.form.c_quality === 1){
                    this.form.c_quality = true;
                }else if(this.form.c_quality === 2){
                    this.form.c_quality = false;
                }
                //配套  地段   字符串转换int数组
                if(!this.form.c_complete){
                    this.form.c_complete = [];
                }else{
                    if(!Array.isArray(this.form.c_complete)){
                        this.form.c_complete = this.intarrFun(this.form.c_complete);
                    }
                }
                if(!this.form.c_lot){
                    this.form.c_lot = [];
                }else{
                    if(!Array.isArray(this.form.c_lot)){
                        this.form.c_lot = this.intarrFun(this.form.c_lot);
                    }
                }
            },
            pagetype(data=Object()){

                //构造默认员工下拉数据
                // this.userTypes = JSON.parse(window.localStorage.getItem('user_down'));
                // console.log(this.userTypes);
                
                var ownerPermission = window.localStorage.getItem('authories');
                var arr = ownerPermission.split(',');
                
                this.ownerPermissionArr = arr;

                this.editresourcesrowdata = sessionStorage.getItem("editresourcesrow");
                this.mineId = window.localStorage.getItem('uid');  //自己的id

                if(this.editresourcesrowdata){   //编辑页 

                    this.editresourcesrowdatajson = JSON.parse(sessionStorage.getItem("editresourcesrow"));

                    this.tjstatus = 2; 

                    //字段权限
                    this.permissionFieldArr.qx_keyuan_kehuxingming = permconfig.qx_keyuan_kehuxingming;  //客户姓名
                    this.permissionFieldArr.qx_keyuan_kehudianhua = permconfig.qx_keyuan_kehudianhua;  //客户电话
                    this.permissionFieldArr.qx_keyuan_lianxirenxingming = permconfig.qx_keyuan_lianxirenxingming;  //联系人姓名
                    this.permissionFieldArr.qx_keyuan_lianxirendianhua = permconfig.qx_keyuan_lianxirendianhua;  //联系人电话
                    this.permissionFieldArr.qx_keyuan_kehuzhuzhi = permconfig.qx_keyuan_kehuzhuzhi;  //客户住址
                    this.permissionFieldArr.qx_keyuan_laiyuan = permconfig.qx_keyuan_laiyuan;  //来源
                    this.permissionFieldArr.qx_keyuan_dengji = permconfig.qx_keyuan_dengji;  //等级
                    this.permissionFieldArr.qx_keyuan_jiaoyileixing = permconfig.qx_keyuan_jiaoyileixing;  //交易类型
                    this.permissionFieldArr.qx_keyuan_zhuangtai = permconfig.qx_keyuan_zhuangtai;  //状态
                    this.permissionFieldArr.qx_keyuan_sike = permconfig.qx_keyuan_sike;  //私客
                    this.permissionFieldArr.qx_keyuan_youzhike = permconfig.qx_keyuan_youzhike;  //优质客
                    this.permissionFieldArr.qx_keyuan_jutidizhi = permconfig.qx_keyuan_jutidizhi;  //具体地址
                    this.permissionFieldArr.qx_keyuan_fangxing = permconfig.qx_keyuan_fangxing;  //房型
                    this.permissionFieldArr.qx_keyuan_zuidamianji = permconfig.qx_keyuan_zuidamianji;  //最大面积
                    this.permissionFieldArr.qx_keyuan_zuixiaomianji = permconfig.qx_keyuan_zuixiaomianji;  //最小面积
                    this.permissionFieldArr.qx_keyuan_zuidashoujia = permconfig.qx_keyuan_zuidashoujia;  //最大售价
                    this.permissionFieldArr.qx_keyuan_zuixiaoshoujia = permconfig.qx_keyuan_zuixiaoshoujia;  //最小售价
                    this.permissionFieldArr.qx_keyuan_weituoshijian = permconfig.qx_keyuan_weituoshijian;  //委托时间
                    this.permissionFieldArr.qx_keyuan_weituofangshi = permconfig.qx_keyuan_weituofangshi;  //委托方式
                    this.permissionFieldArr.qx_keyuan_yongtu = permconfig.qx_keyuan_yongtu;  //用途
                    this.permissionFieldArr.qx_keyuan_fukuanleixing = permconfig.qx_keyuan_fukuanleixing;  //付款类型
                    this.permissionFieldArr.qx_keyuan_beizhu = permconfig.qx_keyuan_beizhu;  //备注
                    this.permissionFieldArr.qx_keyuan_chakansike = permconfig.qx_keyuan_chakansike;  //查看私客
                    this.permissionFieldArr.qx_keyuan_kankehububixiegenjin = permconfig.qx_keyuan_kankehububixiegenjin;  //看客户不必写跟进

                    //初始化  赋值
                    let row = this.editresourcesrowdatajson;
                    console.log(row);
                    //部门员工列表数据
                    this.obtainUsers(row.c_store_id);

                    this.c_id = row.c_id;
                    this.form = row;

                    //查看私客、看客户不必写跟进  权限
                    if(row.c_private_guest == 1){  //私客
                        if(this.ownerPermissionArr.indexOf(permconfig.qx_keyuan_chakansike)  == -1 && row.c_employees_id != window.localStorage.getItem('uid')){
                            this.lookPrivate = 'password';
                            if(this.maininfo == 1){
                                row.customerInfo.info = "【**】 ***********";
                            }
                            
                        }else{
                            this.lookPrivate = 'text';
                        }
                    }else if(row.c_private_guest == 2){  //公客
                        if(this.ownerPermissionArr.indexOf(permconfig.qx_keyuan_kankehububixiegenjin)  == -1 && row.c_employees_id != window.localStorage.getItem('uid')){
                            //需要填写一条跟进后才可查看客户信息
                            this.lookPrivate = 'password';

                            var cache = window.localStorage.getItem("CUSTOMER_PUBLIC_GUEST" + row.c_id);
                            if(!cache){

                                //需要填写跟进，填写完成后存储  "CUSTOMER_PUBLIC_GUEST" + row.c_id
                                this.gjdialogFormVisible = true;  //打开跟进弹框，填写跟进
                                this.classdata = 1; //添加跟进
                                this.permissionFollowVal = 0;

                            }else{
                                this.lookPrivate = 'text';
                                if(this.maininfo == 1){
                                    //添加完跟进 看客户权限更改
                                    row.customerInfo.info = '【' + this.form.c_user_name + '】' + this.form.c_user_phone; 
                                }
                                  
                            }
                            
                        }
                    }

                    

                    this.form.c_room = this.transformInt(row.c_room);
                    this.form.c_source_type = this.transformInt(row.c_source_type);
                    this.form.c_user_level = this.transformInt(row.c_user_level);
                    this.form.c_live_type = this.transformInt(row.c_live_type);
                    this.form.c_professional_type = this.transformInt(row.c_professional_type);
                    this.form.c_user_intention = this.transformInt(row.c_user_intention);
                    this.form.c_time_limit = this.transformInt(row.c_time_limit);
                    this.form.c_room_type = this.transformInt(row.c_room_type);
                    this.form.c_toward = this.transformInt(row.c_toward);
                    this.form.c_decorate_type = this.transformInt(row.c_decorate_type);
                    this.form.c_payment_type = this.transformInt(row.c_payment_type);
                    this.form.c_entrust_type = this.transformInt(row.c_entrust_type);
                    this.form.c_pay_type = this.transformInt(row.c_pay_type);
                    this.form.c_use_type = this.transformInt(row.c_use_type);
                    this.form.c_wc = this.transformInt(row.c_wc);
                    this.form.c_number_of_layers = this.transformInt(row.c_number_of_layers);
                    this.form.c_fence = this.transformInt(row.c_fence);
                    this.form.c_situation = this.transformInt(row.c_situation);
                    this.form.c_level = this.transformInt(row.c_level);

                    if(typeof(this.form.c_room_json) == 'string'){
                        this.form.c_room_json = JSON.parse(row.c_room_json);
                    }
                    
                    data.c_id = this.c_id;
                    if(this.form.c_use_type){
                        //3 住宅 、4 商住 、14 其他
                        //5 商铺 、6 网点 、10 铺厂 
                        //7 写字楼 、9 写厂
                        //8 厂房
                        //11 仓库
                        //12 地皮 
                        //13 车位
                        switch(this.form.c_use_type){
                            case 3:
                                this.typeOne = 1;
                                break;
                            case 4:
                                this.typeOne = 1;
                                break;
                            case 5:
                                this.typeOne = 2;
                                break;
                            case 6:
                                this.typeOne = 2;
                                break;
                            case 7:
                                this.typeOne = 3;
                                break;
                            case 8:
                                this.typeOne = 4;
                                break;
                            case 9:
                                this.typeOne = 3;
                                break;
                            case 10:
                                this.typeOne = 2;
                                break;
                            case 11:
                                this.typeOne = 5;
                                break;
                            case 12:
                                this.typeOne = 6;
                                break;
                            case 13:
                                this.typeOne = 7;
                                break;
                            case 14:
                                this.typeOne = 1;
                                break;
                        }
                    }
                    //传数据至父组件   底部主要信息
                    if(this.maininfo == 1){
                        this.$emit('maininfoevent',row.customerInfo);
                    }
                    
                    // this.maininfo = row.customerInfo;   //主要信息
                    if(this.form.c_buy_status != 455){   //当状态不是 有效 时，存储该状态
                        this.entrust_time_status = this.form.c_buy_status;
                    }
                    this.followstatus = true;   //可添加跟进
                    //传数据至父组件   跟进列表
                    this.$emit('followevent',this.c_id);
                    // this.followlist();  //获取客源跟进列表
                    //获取相匹配的房源列表
                    conf.resources.roominfo(data,(state,res)=>{
                        if(state == 'success'&&res.data.code == 0){
                            // console.log(res);
                            //传数据至父组件   业绩分配成功  可匹配的房源信息
                            this.$emit('housingevent',res.data.data.room_list);//房源信息
                            // this.housing = res.data.data.room_list;  //房源信息
                            //客源  底部信息 内容
                            // this.important_information = res.data.data.important_information;
                        }else if (state == 'success'&&res.data.code != 0){
                            if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                        }
                    })

                    //私客  优质客
                    if(this.form.c_private_guest === 1){
                        this.form.c_private_guest = true;
                    }else if(this.form.c_private_guest === 2){
                        this.form.c_private_guest = false;
                    }
                    if(this.form.c_quality === 1){
                        this.form.c_quality = true;
                    }else if(this.form.c_quality === 2){
                        this.form.c_quality = false;
                    }
                    // //配套  地段
                    if(!this.form.c_complete){
                        this.form.c_complete = [];
                    }else{
                        this.form.c_complete = this.intarrFun(this.form.c_complete);
                        // this.form.c_complete = parseInt(this.form.c_complete);
                        // console.log(typeof(this.form.c_complete));
                    }
                    if(!this.form.c_lot){
                        this.form.c_lot = [];
                    }else{
                        this.form.c_lot = this.intarrFun(this.form.c_lot);
                    }

                    
                }else{  //添加页

                    //添加 权限
                    if(arr.indexOf(permconfig.qx_keyuan_benren_tianjia)  > -1){
                        this.userTypes = [{
                            "u_id": parseInt(window.localStorage.getItem('uid')),
                            "u_username":window.localStorage.getItem("uname")
                        }]
                        // console.log(this.userTypes);
                    }else{
                        //构造默认员工下拉数据
                        this.userTypes = JSON.parse(window.localStorage.getItem('user_down'));
                        // console.log(this.userTypes);
                    }
                    //默认值
                    this.tjstatus = 1;
                    this.form.c_store_id = parseInt(window.localStorage.getItem('did'));
                    this.form.c_employees_id = parseInt(window.localStorage.getItem('uid'));
                    console.log('-----------添加页-------------',this.editresourcesrowdata);
                }
                
            },
            /*返回列表 */
            cancel (formName) {
                this.$router.push({name:'resources'})
            },
            /*提交 */
            submit (formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        this.judgeprimise();
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            /*判断提交 */
            judgeprimise (data=Object()) {
                // this.preservation = false;  //不可保存
                //数据处理(私客、优质客、多选下拉框)
                this.submitbeforeFun();
                if (this.tjstatus == 1) {
                    conf.resources.add(this.form,(state,res)=>{
                        if (state == 'success'&&res.data.code == 0){
                            // console.log(res);
                            
                            this.$message({
                                type: 'success',
                                message: '添加成功!',
                                duration: 1000
                            });
                            this.c_id = res.data.data.c_id;  //客源id
                            this.followstatus = true;   //可添加跟进
                            //传数据至父组件
                            this.$emit('keepevent',res,this.tjstatus);
                            //传数据至父组件   跟进列表
                            this.$emit('followevent',res.data.data.c_id);
                            //数据处理(私客、优质客、多选下拉框)
                            this.submitafterFun();

                        }else if(state == 'success'&&res.data.code != 0){
                            
                            if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                            //数据处理(私客、优质客、多选下拉框)
                            this.submitafterFun();
                        }
                    })
                }else if (this.tjstatus == 2){
                    
                    data = this.form;
                    data.c_id = this.c_id;

                    if(!permconfig.qx_keyuan_liebiao_bianji_function(data)){
                        alert("您没有权限编辑该数据");
                        return;
                    }
                    // console.log(data);
                    if(this.form.c_buy_status == 455 && this.entrust_time_confirm_status === false){   //判断当前状态是否为 有效 
                        if(this.entrust_time_status !== ''){  //判断是否是由之前的状态改变为 有效 的   （若为空，则否。若不为空，则是）
                            this.entrustdialogVisible = true;
                            return;
                        }
                    }
                    conf.resources.edit(data,(state,res)=>{
                        if (state == 'success'&&res.data.code == 0){
                            // console.log(res);
                            this.$message({
                                type: 'success',
                                message: '修改成功!',
                                duration: 1000
                            });
                            //传数据至父组件   添加修改成功   res为返回的数据   this.tjstatus为添加修改的状态
                            this.$emit('keepevent',res,this.tjstatus);
                            //传数据至父组件   跟进列表
                            this.$emit('followevent',this.c_id);

                            //修改客源信息成功 将数据存储sessionStorage，减少http请求，避免刷新頁面時數據丟失
                            sessionStorage.setItem("editresourcesrow", JSON.stringify(data));
                            //数据处理(私客、优质客、多选下拉框)
                            this.submitafterFun();
                            
                        }else if(state == 'success'&&res.data.code != 0){
                            // console.log(res);
                            if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else if(res.data.code == 325){  //需要进行业绩分配
                                this.achievementeditinfo = data;    //存储需要修改的数据信息
                                this.achievementVisible = true;
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                            //数据处理(私客、优质客、多选下拉框)
                            this.submitafterFun();
                        }
                    })
                }
            },
            //接收子组件传值 添加跟进成功  看客户权限更改
            addfollowPer(){
                this.lookPrivate = 'text';
                //传值父组件 添加完跟进 看客户权限更改 c_user_phonec_contactc_contact_type
                let row = this.editresourcesrowdatajson;

                if(this.maininfo == 1){
                    row.customerInfo.info = '【' + this.form.c_user_name + '】' + this.form.c_user_phone;
                    //传数据至父组件   底部主要信息
                    this.$emit('maininfoevent',row.customerInfo);
                }

                
            },
            //接收子组件editfollow   添加跟进成功   
            followievent(){
                this.gjdialogFormVisible = false;
                //传数据至父组件   添加跟进成功   res为返回的数据
                this.$emit('followevent','');
            },
            //接收子组件chooselist
            chooseievent(str,id){
                console.log(str,id);
                this.choose_info_str = str;
                this.r_id = id;
                this.choosekydialogTableVisible = false;
            },
            //验证手机号
            c_validateTel(data=Object()){
                var MobileRegex = /^1[3|4|5|7|8][0-9]{9}$/;
                if (MobileRegex.test(this.form.c_user_phone)) {
                    data.c_user_phone = this.form.c_user_phone;
                    if(this.tjstatus == 2){
                        data.c_id = this.c_id;
                    }
                    conf.resources.validateTel(data,(state,res)=>{
                        if (state == 'success'&&res.data.code == 0){  //可以添加
                            // console.log(res);
                            
                        }else if (state == 'success'&&res.data.code != 0){   //有重复 客源信息
                            if(res.data.code == "error"){
                                this.customer_telephone = this.form.c_user_phone;
                                this.repeatData = res.data.msg;
                                this.repeatdialogVisible = true;
                            }else if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                            
                        }
                    })
                }            
            },
            //获取客源下拉
            custoptlist(data=Object()){

                if(window.localStorage.customeroptdata){
                    this.customeroptlist = JSON.parse(window.localStorage.getItem("customeroptdata"));
                    if(this.tjstatus == 1){  //委托时间
                        this.form.c_entrust_time = JSON.parse(window.localStorage.getItem("customeroptdata")).day;
                    }
                }else{
                    conf.resources.optlist(data,(state,res)=>{
                        if (state == 'success'&&res.data.code == 0){
                            // console.log(res);
                            //定位偶尔请求失败 res.data.data.city_name 返回null，地址默认为北京市
                            if(res.data.data.city_name){
                                this.customeroptlist = res.data.data;
                                if(this.tjstatus == 1){
                                    this.form.c_entrust_time = res.data.data.day;
                                }
                                let obj = JSON.stringify(res.data.data); //转化为JSON字符串
                                window.localStorage.setItem("customeroptdata", obj);
                            }else{
                                this.custoptlist();
                            }

                            
                            
                        }else if (state == 'success'&&res.data.code != 0){
                            if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                        }
                    })
                }
                
            },
            //业绩分配   添加部门员工
            add_user(){
                let cope = {user_id:'',percent:'',department_id:''}
                this.achievement_userlist.push(cope);
            },
            //业绩分配   删除
            del_user(ind){
                this.achievement_userlist.splice(ind,1);
            },
            //业绩分配  类型（多人、单人）  change
            atypechange(val){
                if(val == 1){  //单人
                    this.achievementaddbtn = false;
                    this.achievement_userlist = [{user_id:'',percent:'100',department_id:''}];
                }else if(val == 2){  //多人
                    this.achievementaddbtn = true;
                    this.achievement_userlist = [{user_id:'',percent:'',department_id:''}];
                }
            },
            //业绩分配  取消
            achievementcancel(formName){
                this.achievementVisible = false;
            },
            //业绩分配   提交
            achievementsubmit(formName,data=Object()){
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        data = this.achievementeditinfo;
                        if(this.choose_info_str == ''){
                            this.$message({
                                type: 'warning',
                                message: '请选择房源信息',
                                duration: 1000
                            });
                        }
                        var all_rate = 0;
                        var a_rate = '';
                        var a_uid = '';
                        if(this.achievement_userlist.length == 1){
                            if(this.achievement_userlist[0].user_id == '' || this.achievement_userlist[0].percent == ''){
                                this.$message({
                                    type: 'warning',
                                    message: '请填写完整',
                                    duration: 1000
                                });
                                return;
                            }else{
                                if(this.achievement_userlist[0].percent != 100){
                                    this.$message({
                                        type: 'warning',
                                        message: '请输入正确的业绩分配比例',
                                        duration: 1000
                                    });
                                    return;
                                }else{
                                    data.a_rate = this.achievement_userlist[0].percent;
                                    data.a_uid = this.achievement_userlist[0].user_id;
                                }
                                
                            }
                            
                        }else{               
                            for(var i = 0;i<this.achievement_userlist.length;i++){
                                if(this.achievement_userlist[i].user_id == '' || this.achievement_userlist[i].percent == ''){
                                    this.$message({
                                        type: 'warning',
                                        message: '请填写完整',
                                        duration: 1000
                                    });
                                    return;
                                }else{
                                    all_rate += parseFloat(this.achievement_userlist[i].percent);
                                    
                                    a_rate += this.achievement_userlist[i].percent +',';
                                    a_uid += this.achievement_userlist[i].user_id +',';
                                }
                            }
                            if(all_rate != 100){
                                this.$message({
                                    type: 'warning',
                                    message: '请输入正确的业绩分配比例',
                                    duration: 1000
                                });
                                return;
                            }else{
                                data.a_rate = a_rate.substr(0,a_rate.length-1);
                                data.a_uid = a_uid.substr(0,a_uid.length-1);
                            } 
                        }
                        data.id = this.r_id;
                        data.c_id = this.c_id;
                        data.a_type = this.achievementform.a_type;
                        data.a_money = this.achievementform.a_money;
                        data.a_remark = this.achievementform.a_remark;
                        conf.resources.addachievement(data,(state,res)=>{
                            if (state == 'success'&&res.data.code == 0){
                                // console.log(res);
                                this.$message({
                                    type: 'success',
                                    message: '修改成功!',
                                    duration: 1000
                                });
                                this.achievementVisible = false;
                                this.choose_room_info = '';
                                //修改客源信息成功 将数据存储sessionStorage，减少http请求，避免刷新頁面時數據丟失
                                sessionStorage.setItem("editresourcesrow", JSON.stringify(data));
                                //传数据至父组件   业绩分配成功  可匹配的房源信息
                                this.$emit('housingevent',res.data.data.room_list);//房源信息
                                //传数据至父组件   添加跟进成功   res为返回的数据
                                this.$emit('followevent',res);
                                //数据处理  （配置、地段、私客、优质客）
                                this.submitafterFun();
                            }else if(state == 'success'&&res.data.code != 0){
                                if(res.data.code == 401){
                                    this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                                }else{
                                    this.$message({
                                        type: 'info',
                                        message: res.data.msg
                                    });
                                }
                            }
                        })

                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            //添加客源跟进
            followup(){
                this.gjdialogFormVisible = true;
            },
            //取消客源跟进
            gjcancel(formName){
                this.$refs[formName].resetFields();
            },
            //提交客源跟进
            gjsubmit(formName,data=Object()){
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        data = this.followform;
                        data.cf_c_id = this.c_id;
                        if(this.followform.cfs_remind_time){
                            if(this.followform.cfs_content == ''){
                                this.$message({
                                    type: 'info',
                                    message: '请输入提醒内容',
                                    duration: 1000
                                });
                                return;
                            }else if(this.followform.cfs_user_id == ''){
                                this.$message({
                                    type: 'info',
                                    message: '请选择被提醒人',
                                    duration: 1000
                                });
                                return;
                            }
                        }
                        //跟进方式  为看房时  提交该房源的房源id
                        if(this.followform.cf_fllow_type == 3){
                            
                            if(this.r_id == ''){
                                this.$message({
                                    type: 'info',
                                    message: '请选择看房房源',
                                    duration: 1000
                                });
                                return;
                            }else{
                                this.followform.cfs_type_id = this.r_id;
                            }
                        }else{
                            this.followform.cfs_type_id = '';
                            //初始化  已选择的房源信息   避免影响别处
                            this.choose_room_info = '';
                        }
                        conf.resources.addfollow(data,(state,res)=>{
                            if (state == 'success'&&res.data.code == 0){
                                // console.log(res);
                                this.$message({
                                    type: 'success',
                                    message: '添加成功!',
                                    duration: 1000
                                });
                                this.gjdialogFormVisible = false;
                                this.choose_room_info = '';
                                //传数据至父组件   添加跟进成功   res为返回的数据
                                this.$emit('followevent',res);
                            }else if(state == 'success'&&res.data.code != 0){
                                if(res.data.code == 401){
                                    this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                                }else{
                                    this.$message({
                                        type: 'info',
                                        message: res.data.msg
                                    });
                                }
                            }
                        })

                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            //下次提醒日期改变
            changedate(val){
                // console.log(val);
                if(val){
                    this.remind = true;
                }else{
                    this.remind = false;
                    this.followform.cfs_remind_time = '';
                    this.followform.cfs_user_id = '';
                    this.followform.cfs_content = '';
                }
            },
            //房源列表
            roomlist(data=Object()){
                // console.log(data);
                conf.room.list(data,(state,res)=>{
                    if (state == 'success'&&res.data.code == 0){
                        // console.log(res);
                        this.housingData = res.data.data.data;
                    }else if(state == 'success'&&res.data.code != 0){
                        if(res.data.code == 401){
                            this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                        }else{
                            this.$message({
                                type: 'info',
                                message: res.data.msg
                            });
                        }
                    }
                })
            },
            //选择房源
            choose_housing(){
                //清空搜索条件
                this.housingform.r_d_id = '';
                this.housingform.source_uid = '';
                this.housingform.a_id = '';
                this.housingform.trading_type = '';
                this.housingform.status = '';
                this.housingform.keywords = '';
                this.housingData = [];

                this.choosekydialogTableVisible = true;
            },
            //查询房源
            searchbtn(formName){
                let data = this.housingform;
                this.roomlist(data);
            },
            //确认选择  房源
            changecustomerbtn(row){
                console.log(row);
                this.r_id = row.id;  //选择的房源id
                this.choose_room_info = row.property_number  +  row.building_name  +  row.few_building  +  row.position + row.r_acreage +'㎡';  //选择的房源展示内容
                this.choosekydialogTableVisible = false;
            },
            //取消  修改状态为 有效  委托时间
            entrustcancel(){
                this.entrustdialogVisible = false;
                this.entrust_time_confirm_status = true;
            },
            //确认  修改状态为 有效  委托时间
            entrustsubmit(){
                this.form.r_entrust_at = this.options.day;  //委托时间修改为今天
                this.entrustdialogVisible = false;
                this.entrust_time_confirm_status = true;
            },
            //取消  查看客源重复
            repeatcancel(){
                this.repeatdialogVisible = false;
            },
            //重複客源信息  
            repeatsubmit(){
                this.repeatdialogVisible = false;
                console.log(this.repeatData);
                this.c_id = this.repeatData.c_id;

                this.form = this.repeatData;
                this.tjstatus = 2;

                //修改重複客源信息时 将数据存储sessionStorage，减少http请求 ，避免刷新頁面時數據丟失
                sessionStorage.setItem("editresourcesrow", JSON.stringify(this.repeatData));

                //重复房源的内容
                
                if(typeof(this.repeatData.c_room_json) == 'string'){
                    // console.log(JSON.parse(this.repeatData.c_room_json));
                    this.form.c_room_json = JSON.parse(this.repeatData.c_room_json);
                }

                this.form.c_use_type = this.transformInt(this.repeatData.c_use_type);
                if(this.form.c_use_type){
                    //3 住宅 、4 商住 、14 其他
                    //5 商铺 、6 网点 、10 铺厂 
                    //7 写字楼 、9 写厂
                    //8 厂房
                    //11 仓库
                    //12 地皮 
                    //13 车位
                    switch(this.form.c_use_type){
                        case 3:
                            this.typeOne = 1;
                            break;
                        case 4:
                            this.typeOne = 1;
                            break;
                        case 5:
                            this.typeOne = 2;
                            break;
                        case 6:
                            this.typeOne = 2;
                            break;
                        case 7:
                            this.typeOne = 3;
                            break;
                        case 8:
                            this.typeOne = 4;
                            break;
                        case 9:
                            this.typeOne = 3;
                            break;
                        case 10:
                            this.typeOne = 2;
                            break;
                        case 11:
                            this.typeOne = 5;
                            break;
                        case 12:
                            this.typeOne = 6;
                            break;
                        case 13:
                            this.typeOne = 7;
                            break;
                        case 14:
                            this.typeOne = 1;
                            break;
                    }
                }

                this.form.c_room = this.transformInt(this.repeatData.c_room);
                this.form.c_source_type = this.transformInt(this.repeatData.c_source_type);
                this.form.c_user_level = this.transformInt(this.repeatData.c_user_level);
                this.form.c_live_type = this.transformInt(this.repeatData.c_live_type);
                this.form.c_professional_type = this.transformInt(this.repeatData.c_professional_type);
                this.form.c_user_intention = this.transformInt(this.repeatData.c_user_intention);
                this.form.c_time_limit = this.transformInt(this.repeatData.c_time_limit);
                this.form.c_room_type = this.transformInt(this.repeatData.c_room_type);
                this.form.c_toward = this.transformInt(this.repeatData.c_toward);
                this.form.c_decorate_type = this.transformInt(this.repeatData.c_decorate_type);
                this.form.c_payment_type = this.transformInt(this.repeatData.c_payment_type);
                this.form.c_entrust_type = this.transformInt(this.repeatData.c_entrust_type);
                this.form.c_pay_type = this.transformInt(this.repeatData.c_pay_type);
                
                this.followstatus = true;   //可添加跟进

                //数据处理
                this.submitafterFun();
            },
            // 用途 change
            typeChange(val){
                // console.log(val);
                //3 住宅 、4 商住 、14 其他
                //5 商铺 、6 网点 、10 铺厂 
                //7 写字楼 、9 写厂
                //8 厂房
                //11 仓库
                //12 地皮 
                //13 车位
                switch(val){
                    case 3:
                        this.typeOne = 1;
                        this.initOne();
                        break;
                    case 4:
                        this.typeOne = 1;
                        this.initOne();
                        break;
                    case 5:
                        this.typeOne = 2;
                        this.initTwo();
                        break;
                    case 6:
                        this.typeOne = 2;
                        this.initTwo();
                        break;
                    case 7:
                        this.typeOne = 3;
                        this.initThree();
                        break;
                    case 8:
                        this.typeOne = 4;
                        this.initFour();
                        break;
                    case 9:
                        this.typeOne = 3;
                        this.initThree();
                        break;
                    case 10:
                        this.typeOne = 2;
                        this.initTwo();
                        break;
                    case 11:
                        this.typeOne = 5;
                        this.initFive();
                        break;
                    case 12:
                        this.typeOne = 6;
                        this.initSix();
                        break;
                    case 13:
                        this.typeOne = 7;
                        this.initSeven();
                        break;
                    case 14:
                        this.typeOne = 1;
                        this.initOne();
                        break;
                }
            },
            //初始化数据  this.typeOne = 1
            initOne(){
                this.form.c_room_type = '';  //类型
                this.form.c_floor = '';  //楼层
                this.form.c_toward = '';  //朝向 
                this.form.c_decorate_type = '';  //装修
                this.form.c_complete = [];  //配套
            },
            //初始化数据  this.typeOne = 2
            initTwo(){
                this.form.c_room_type = '';  //类型
                this.form.c_industry = '';  //行业
                this.form.c_number_of_layers = '';  //层数 
                this.form.c_wc = '';  //厕所
                this.form.c_lot = [];  //地段
                this.form.c_position = '';  //位置
            },
            //初始化数据  this.typeOne = 3
            initThree(){
                this.form.c_room_type = '';  //类型
                this.form.c_floor = '';  //楼层
                this.form.c_number_of_layers = '';  //层数 
                this.form.c_wc = '';  //厕所
                this.form.c_complete = [];  //配套
            },
            //初始化数据  this.typeOne = 4
            initFour(){
                this.form.c_room_type = '';  //类型
                this.form.c_electricity = '';  //电量 
                this.form.c_number_of_layers = '';  //层数
                this.form.c_fence = '';  //围墙 
                this.form.c_complete = [];  //配套
            },
            //初始化数据  this.typeOne = 5
            initFive(){
                this.form.c_room_type = '';  //类型
                this.form.c_electricity = '';  //电量
                this.form.c_number_of_layers = '';  //层数 
                this.form.c_fence = '';  //围墙
                this.form.c_complete = [];  //配套
            },
            //初始化数据  this.typeOne = 6
            initSix(){
                this.form.c_room_type = '';  //类型
                this.form.c_parking = '';  //停车
                this.form.c_situation = '';  //状况 
                this.form.c_fence = '';  //围墙
                this.form.c_complete = [];  //配套
            },
            //初始化数据  this.typeOne = 7
            initSeven(){
                this.form.c_room_type = '';  //类型
                this.form.c_parking = '';  //停车
                this.form.c_situation = '';  //状况 
                this.form.c_fence = '';  //围墙
                this.form.c_complete = [];  //配套 
                this.form.c_position = '';  //位置 
            },
            //获取部门
            obtainName(data=Object()){

                if(this.tjstatus == 1){  //添加
                    conf.department.nameOpt(data,(state,res)=>{
                        if (state == 'success'&&res.data.code == 0){
                            this.optionName = res.data.data;
                            // console.log(res); 
                        }else if(state == 'success'&&res.data.code != 0){
                            if(res.data.code == -404){
                                this.optionName = [];
                            }else if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                        }
                    }, 'qx_keyuan_tianjia')
                }else if(this.tjstatus == 2){  //修改

                    conf.department.nameOpt(data,(state,res)=>{
                        if (state == 'success'&&res.data.code == 0){
                            this.optionName = res.data.data;
                            // console.log(res); 
                        }else if(state == 'success'&&res.data.code != 0){
                            if(res.data.code == -404){
                                this.optionName = [];
                            }else if(res.data.code == 401){
                                this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                            }else{
                                this.$message({
                                    type: 'info',
                                    message: res.data.msg
                                });
                            }
                        }
                    })
                }

         
                
            },
            //获取部门员工
            obtainUsers(val,data=Object()){
                this.form.c_employees_id = '';
                this.userTypes = [];
                data.d_id = val;
                // var ownerPermission = window.localStorage.getItem('authories');
                // var arr = ownerPermission.split(',');
                // if(arr.indexOf(permconfig.qx_keyuan_benren_tianjia)  > -1){
                //     this.userTypes = [{
                //         "u_id": parseInt(window.localStorage.getItem('uid')),
                //         "u_username":window.localStorage.getItem("uname")
                //     }]
                //     // console.log(this.userTypes);
                //     return;
                // }
                conf.department.userOpt(data,(state,res)=>{
                    if (state == 'success'&&res.data.code == 0){
                        // console.log(res); 
                        this.userTypes = res.data.data;
                    }else if(state == 'success'&&res.data.code != 0){
                        if(res.data.code == 401){
                            this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                        }else{
                            this.$message({
                                type: 'info',
                                message: res.data.msg
                            });
                        }
                    }
                })
            },
            //获取部门员工(房源跟进)
            obtainuser(val,data=Object()){
                this.usertypes = [];
                this.followform.f_user_id = '';
                data.d_id = val;
                conf.department.userOpt(data,(state,res)=>{
                    if (state == 'success'&&res.data.code == 0){
                        // console.log(res); 
                        this.usertypes = res.data.data;
                    }else if(state == 'success'&&res.data.code != 0){
                        if(res.data.code == 401){
                            this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                        }else{
                            this.$message({
                                type: 'info',
                                message: res.data.msg
                            });
                        }
                    }
                })
            },
            //获取部门员工(客源跟进  房源列表 查询)
            obtainusers(val,data=Object()){
                this.usertypess = [];
                this.housingform.source_uid = '';
                data.d_id = val;
                conf.department.userOpt(data,(state,res)=>{
                    if (state == 'success'&&res.data.code == 0){
                        // console.log(res); 
                        this.usertypess = res.data.data;
                    }else if(state == 'success'&&res.data.code != 0){
                        if(res.data.code == 401){
                            this.$router.push({name:'login'});   //登陆态失效，跳转至登录页
                        }else{
                            this.$message({
                                type: 'info',
                                message: res.data.msg
                            });
                        }
                    }
                })
            },
            // 交易类型  change  
            transactChange(val){
                // console.log(val);
                //451 求购、452 求租 、453 租购
                if(val === 451){
                    this.transaction = 1;
                    this.form.c_rent_price_min = '0.00';
                    this.form.c_rent_price_max = '0.00';
                }else if(val === 452){
                    this.transaction = 2;
                    this.form.c_price_min = '0.00';
                    this.form.c_price_max = '0.00';
                }else if(val === 453){
                    this.transaction = 3;
                }
            },
        },
        created (){
            this.$nextTick(function(){
                this.pagetype();  //页面状态  （修改、添加）
                this.custoptlist(); //客源下拉数据
                this.obtainName();  //部门下拉
                // this.obtainUsers();  //部门员工
            })
        },

    }
</script>